package com.lmf.annotation.config;

import com.lmf.annotation.service.MyService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
@ComponentScan({"com.lmf.annotation.dao","com.lmf.annotation.service","com.lmf.annotation.controller"})
public class MyConfigOfAutowired {
    @Primary
    @Bean("myService_2")
    public MyService myService(){
        return new MyService("为人民服务...myService_2");
    }
}
